package core;

import java.nio.ByteBuffer;

public class PipeHandler extends TemplateHandler implements Handler{

    @Override
    public void channelRead(HandlerContext ctx, Object msg) {
        super.channelRead(ctx,msg);
        // 传递给下一个
        ctx.ChannelRead(msg);
    }

    @Override
    public void write(HandlerContext ctx, Object msg) {
        super.write(ctx,msg);
        ctx.channel.doWriteQueue((ByteBuffer) msg);
    }

    @Override
    public void flush(HandlerContext ctx) {
        super.flush(ctx);
        ctx.channel.doFlush();
    }
}
